#pragma once

// alt: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1615.pdf

#pragma region PROPGS(name,type) -> property with auto-implemented setter and getter
#define PROPGS(name,type) \
	private: \
		type m_##name; \
	public: \
		type get##name() { return m_##name; } \
		void set##name(type name) { m_##name = name; } \
		__declspec(property(get = get##name, put = set##name)) type name; \
	// end of macro PROPGS
#pragma endregion

#pragma region PROP(name,type,getter,setter) -> property with custom getter and setter
#define PROP(name,type,getter,setter) \
	private: \
		type m_##name; \
	public: \
		type get##name() { getter } \
		void set##name(type name) { setter } \
		__declspec(property(get = get##name, put = set##name)) type name; \
	// end of macro PROP
#pragma endregion

#pragma region PROPWO(name,type,setter) -> write-only property with custom setter
#define PROPWO(name,type,setter) \
	public: \
		void set##name(type name) { setter } \
		__declspec(property(put = set##name)) type name; \
	// end of macro PROPWO
#pragma endregion

#pragma region PROPRO(name,type,getter) -> read-only property with custom getter
#define PROPRO(name,type,getter) \
	public: \
		type get##name() { getter } \
		__declspec(property(get = get##name)) type name; \
	// end of macro PROPRO
#pragma endregion
